Beer
====

If this system is useful to you, please Beer me by Paypal.
In return I'll send you an extra (usually paid for) Addon for this system.

Beer Paypal Link:
https://www.paypal.com/donate/?hosted_button_id=7EHJT2SPC7X7E

Thank you in advance.




Queued Emails
=============

This is the core foundation for Queued Emails.

DO NOT INSTALL ON VERSION 1.0.8.4 OR LOWER 
DO NOT INSTALL ON VERSION 1.0.9.6 OR HIGHER



Support/Discussion/Feedback
---------------------------
https://phoenixcart.org/forum/viewtopic.php?f=28&t=2596




Installation
------------

Installation should not take more than 2 minutes.


1. Upload all (except this README)
2. Run SQL (eg in phpMyAdmin or similar), see SQL below
2. Install new Header Tag module [admin > modules > header tags > {install}]
3. Change Email Templates to suit your site [see new link in horizontal menu in header]



Scheduler Modules
-----------------
https://phoenixcart.org/phoenixcartwiki/index.php?title=Queued_Emails#Scheduler_Modules


Email Templates
---------------
https://phoenixcart.org/phoenixcartwiki/index.php?title=Queued_Emails#Outgoing_E-mail_Templates

Email Queue
-----------
https://phoenixcart.org/phoenixcartwiki/index.php?title=Queued_Emails#Outgoing_Queue



Use
---
Once per day click "send ready emails".




Versioning
----------
v1.0.8.5 through to v1.0.9.5



SQL
---
CREATE TABLE outgoing (
  id int(11) NOT NULL AUTO_INCREMENT,
  customer_id int(11) NOT NULL,
  identifier varchar(255) NULL DEFAULT NULL,
  send_at datetime NOT NULL,
  fname varchar(255) NOT NULL,
  lname varchar(255) NOT NULL,
  email_address varchar(255) NOT NULL,
  slug varchar(255) NOT NULL,
  merge_tags longtext,
  date_added datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  last_modified datetime DEFAULT NULL,
  PRIMARY KEY (id)
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

CREATE TABLE outgoing_tpl (
  id int(11) NOT NULL AUTO_INCREMENT,
  slug varchar(255) NOT NULL,
  title varchar(255) NOT NULL,
  text longtext NOT NULL,
  date_added datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  last_modified datetime DEFAULT NULL,
  PRIMARY KEY (id)
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

INSERT INTO outgoing_tpl (id, slug, title, text, date_added) VALUES ('1', 'no_checkout', '{{FNAME}}, no checkout?', 'Hi {{FNAME}}\r\n\r\nWe noticed you registered on our site back on the {{SIGN_UP_DAY}} of {{SIGN_UP_MONTH}} but you did not checkout.\r\n\r\nIf you had a problem with our site, please do not hesitate to contact us.', NOW());
INSERT INTO outgoing_tpl (id, slug, title, text, date_added) VALUES ('2', 'order_thanks', '{{FNAME}} thank you for Order #{{ORDER_ID}}', 'Hi {{FNAME}}\r\n\r\nThank you for Order #{{ORDER_ID}} made on {{ORDER_DATE}}.  We are working to pick and pack your Order and will update you at each stage of the process.\r\n\r\nYou ordered:\r\n{{ORDER_PRODUCTS}}\r\n\r\nIf you have any questions about this Order or our site, please do not hesitate to contact us.', NOW());
INSERT INTO outgoing_tpl (id, slug, title, text, date_added) VALUES ('3', 'winback', '{{FNAME}}, we\'ve missed you', 'Hi {{FNAME}}\r\n\r\nWe really hope you enjoyed your products that you ordered back on {{ORDER_DATE}}\r\n\r\nWe have new products we think you might be interested in.', NOW());